package com.cmc.cloud.cmclink.doc.controller.admin.rpc;

import com.cmc.cloud.cmclink.doc.constants.UrlConstants;
import com.cmc.cloud.cmclink.doc.rpcservice.VoyScheduleService;
import com.cmc.cloud.cmclink.svl.api.base.req.VesselVoyReqDTO;
import com.cmc.cloud.cmclink.svl.api.base.resp.VesselVoyRespDTO;
import com.cmes.framework.common.pojo.CommonResult;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;


/**
 * 提单货物信息前端接口Controller
 *
 * @author codegen
 */
@Tag(name = "单证对外rpc包装的web 接口")
@RestController
@Validated
@RequestMapping(UrlConstants.APPLICATION_URL + "/blnoRpc")
public class BlnoRpcController {

    @Resource
    private VoyScheduleService voyScheduleService;


    @Operation(summary = "根据船名航次加港口获取 eta etd")
    @PostMapping("/getVslvoyTime")
    public CommonResult<List<VesselVoyRespDTO>> getVslvoyTime(@Valid @RequestBody VesselVoyReqDTO vesselVoyReqDTO) {
        List<VesselVoyRespDTO> vesselVoyRespDtos = voyScheduleService.listVesselVoy(vesselVoyReqDTO);
        return CommonResult.success(vesselVoyRespDtos);
    }

}
